//
//  FMAntorOtherTableViewCell.m
//  PsychologyFM
//
//  Created by 杜建虎 on 16/1/13.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMAntorOtherTableViewCell.h"

@implementation FMAntorOtherTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _iconImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, kScreenWidth / 6, kScreenWidth / 6)];
        _iconImage.layer.masksToBounds = YES;
        _iconImage.layer.cornerRadius = kScreenWidth / 6 / 2;
        [self.contentView addSubview:_iconImage];
        
        _userLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth / 6 + self.iconImage.frame.origin.x + 10, 24, kScreenWidth / 5, 20)];
        _userLabel.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:_userLabel];
        
        _numberWorkLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - kScreenWidth / 4, self.userLabel.frame.origin.y, kScreenWidth / 4, _userLabel.frame.size.height)];
        _numberWorkLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_numberWorkLabel];
    }
    return self;
}

- (void)setModel:(FMAntorMoreModel *)model
{
    _model = model;
    _iconImage.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:model.user[@"avatar"]]]];
    _userLabel.text = model.title;
    _numberWorkLabel.text = [NSString stringWithFormat:@"%@个节目",model.fmnum];
}

@end
